#include "entry_switch.h"

using namespace std;

void entry_switch::read_from_file(FILE* file) {
	char temp_string[999];
	fscanf(file , "%s" , temp_string);
	if(strcmp(temp_string , "on") == 0) {
		*my_bool_pointer_ = true;
	}
	else {
		*my_bool_pointer_ = false;
	}
}

string entry_switch::to_string() const {
	stringstream temp_stringstream;
	temp_stringstream << ((*my_bool_pointer_)? "on" : "off");
	return temp_stringstream.str();
}